package main

import (
	"go-glue.googlecode.com/hg/rlglue"
)

type EmptyAgent struct {
	whichEpisode	int
	emptyAction	rlglue.Action
	nonEmptyAction	rlglue.Action
}

func (ea *EmptyAgent) AgentInit(taskString string) {
	ea.whichEpisode = 0
	ea.emptyAction = rlglue.NewAction([]int32{}, []float64{}, []byte{})
	ea.nonEmptyAction = rlglue.NewAction([]int32{0, 1, 2, 3, 4, 5, 6}, []float64{0.0 / 3.0, 1.0 / 3.0, 2.0 / 3.0}, []byte{'a'})
}
func (ea *EmptyAgent) AgentStart(obs rlglue.Observation) (act rlglue.Action) {
	ea.whichEpisode += 1
	if ea.whichEpisode%2 == 0 {
		act = ea.emptyAction
	} else {
		act = ea.nonEmptyAction
	}
	return
}
func (ea *EmptyAgent) AgentStep(reward float64, obs rlglue.Observation) (act rlglue.Action) {
	if ea.whichEpisode%2 == 0 {
		act = ea.emptyAction
	} else {
		act = ea.nonEmptyAction
	}
	return
}
func (ea *EmptyAgent) AgentEnd(reward float64) {
}
func (ea *EmptyAgent) AgentCleanup() {
}
func (ea *EmptyAgent) AgentMessage(message string) (reply string) {
	return
}
func main() {
	if err := rlglue.LoadAgent(new(EmptyAgent)); err != nil {
		panic(err)
	}
}
